package doughnut.xc.pojo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;

/**
 * 员工
 */
@Data
@Table(name="tb_user")
public class User {

    /**
     * 主键
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    @Excel(name = "编号")
    private Long id;

    /**
     * 员工名
     */
    @Excel(name = "姓名")
    private String userName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 省份名
     */
    private String province;

    /**
     * 城市名
     */
    private String city;

    /**
     * 工资
     */
    // 导入：isImportField = "true" excel表中必须有该列，否则报错 ，默认false
    @Excel(name = "工资", type = 10, isImportField = "true")
    private Integer salary;

    /**
     * 入职日期
     */
    @Excel(name = "入职日期", format = "yyyy-MM-dd", width = 20)
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date hireDate;

    /**
     * 部门id
     */
    private String deptId;

    /**
     * 出生日期
     */
    private Date birthday;

    /**
     * 一寸照片
     */
    // 导出：假设图片放在项目static下： 则数据库的路径 static/user_photos/4.jpg
    @Excel(name = "照片", type = 2, orderNum = "1", width = 20, savePath = "C:\\Users\\29469\\OneDrive\\桌面\\可视化\\user_management\\src\\main\\resources\\static\\easyPOI_import_demo\\")
    private String photo;

    /**
     * 现在居住地址
     */
    @Excel(name = "居住地址", width = 30)
    private String address;

    /**
     * 办公用品
     */
    private List<Resource> resourceList;

}
